package com.hth.feign.provider;


import com.hth.feign.api.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProviderController {

    @Autowired
    PersonProvider api;

    @GetMapping("/name")
    public String getName() {
        System.out.println("come in");
        return api.getName();
    }

    @GetMapping("/get/person")
    public Person getPerson(){
        return api.getPerson();
    }

    @PostMapping("/set/person")
    public String setPerson(@RequestParam Person person) {
        return api.setPerson(person);
    }
}
